
internal CollectorDemo: IView {
	subnode CollectorDemo

	text(value) {
		return this
	}
}

internal CollectorDemoFactory {
	new_collector_demo() {
		return CollectorDemo()
	}
}

internal new_collector_demo() {
	return CollectorDemo()
}

internal collector1() String >> Array {

	// would collect
	<div>hei~</div>

	// would collect
	CollectorDemo()

	// would collect
	CollectorDemo().subnode.text('red').subnode = new_collector_demo()

	// would not collect, because it assigned to a variable
	abc = CollectorDemo()

	factory = CollectorDemoFactory()

	// would not collect, because it not class-new expression
	new_collector_demo()
	factory.new_collector_demo()

	if 1 {
		// would collect
		CollectorDemo().text('red').subnode.text('hei~')
	}

	// would collect each one
	for item in [1, 2, 3] {
		CollectorDemo().subnode.text('hello')
	}
}
